package com.company;

public class Rectangle extends Shape{

    private double width;
    private double height;

    public Rectangle() {
    }

    public Rectangle(double height, double width, String color) {
        super(color);
        this.width = width;
        this.height = height;
    }

    @Override
    public double getArea() {

        return width*height;
    }

    @Override
    public double getPer() {
        return (width+height)*2;
    }

    @Override
    public void showAll() {
        System.out.println("矩形长：" + width + "\t矩形宽：" + height);
        System.out.println("矩形面积：" + getArea() + "\t矩形周长：" + getPer());
        System.out.println("矩形颜色为：" + getColor());
    }


}
